package main.java.zemo.game;
import java.util.List;



public class ShootCorridor extends Command{

	/**
	 * @uml.property  name="aCorridorAndRoom"
	 * @uml.associationEnd  inverse="shootCorridor:ACorridorAndRoom"
	 */
	private ACorridorAndRoom aCorridorAndRoom;
	public ShootCorridor(ACorridorAndRoom aCorridorAndRoom){
		this.aCorridorAndRoom=aCorridorAndRoom;		
	}
	public void execute(Player p,Tablet t){
		// envio a shoot la lista de jugadores cercanos al player p implementada en la clasCommand
		//para evitar el mal olor de codigo duplicado
		List<Player> playerCorridor=playerInCorridor(p,t);
		
		aCorridorAndRoom.shoot(playerCorridor,p,playerAdy(p,t),t);		
	}

	/**
	 * Getter of the property <tt>aCorridorAndRoom</tt>
	 * @return  Returns the aCorridorAndRoom.
	 * @uml.property  name="aCorridorAndRoom"
	 */
	public ACorridorAndRoom getACorridorAndRoom() {
		return aCorridorAndRoom;
	}

	/**
	 * Setter of the property <tt>aCorridorAndRoom</tt>
	 * @param aCorridorAndRoom  The aCorridorAndRoom to set.
	 * @uml.property  name="aCorridorAndRoom"
	 */
	public void setACorridorAndRoom(ACorridorAndRoom aCorridorAndRoom) {
		this.aCorridorAndRoom = aCorridorAndRoom;
	}

}
